<template>
  <div class="container-y">
    <div class="d-item-wrap">
      <div class="d-title"></div>
      <div class="d-content">
        <div class="item">
          <div class="label">
            <div class="neededFlag"></div>
            {{label}}
          </div>
          <div class="txt">
            <textarea id="content"
                      class="txt-area"
                      placeholder="点击输入文字">
            </textarea>
          </div>
        </div>
      </div>
    </div>
    <!--按钮区域-->
    <div class="btn-wrap">
      <div class="btn-b" @click="confirm(1)">确定</div>
      <div class="btn-b" @click="confirm(2)">继续跟踪</div>
    </div>
  </div>
</template>

<script>
  export default {
    data() {
      return {
        label: "",
      }
    },
    methods: {
      init() {
        this.type = _methods.getUrlParam("type") - 0;
        this.flag = _methods.getUrlParam("flag");
        switch (this.type) {
          case 1:
            this.label = "审核意见";
            break;
          case 2:
            this.label = "协调处置要求";
            break;
        }
      },
      //继续跟踪提交
      confirm(exStatus){
        let content = _methods.getValue("content");
        if (!content) {
          mui.toast(`请输入${this.label}`);
          return;
        }
        else {
          let data = {
            fId: _data.feedBackChecked.id,
            content: content,
            exStatus: exStatus,
            infoType: 3
          };
          _ajax.confirmWithLoading(_ajaxUrls.feedBackContinue.url,
            data,
            () => {
              if (this.flag == 1) {
                window._methods.indexLIstRefresh();
              }
              if (this.flag == 2) {
                window._methods.myTaskLIstRefresh();
              }
              _alert.alert(() => {
                _methods.goBack();
                setTimeout(()=>{
                  _data.bus.$emit("refresh", 1);
                },100)
              });
            }, _ajaxUrls.feedBackContinue.type);
        }

      },
    },
    created() {
      this.init();
    },
  }
</script>
